<?php


namespace app\common\model\mysql;


use think\Model;

class BaseModel extends Model
{
    public function updateById($goods_id, $update_data)
    {
        $update_data['update_time'] = time();
        return $this->where(['id' => $goods_id])->save($update_data);
    }

    public function getByCondition($data)
    {
        if (!$data || !is_array($data)) {
            return false;
        }

        return $this->where($data)->select()->toArray();
    }
}